This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Nov 17, 2011, 12:13 AM
6 Posts

ExtLib NamePicker: How can I return a different column from the one shown?

  • Category: Extension Library
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: ExtLib,NamePicker
  • Replies: 3
On one of my XPages, I have set up five NamePickers that  allow the users to select values from five different lists and store the results into a single field. I have noticed that with multiple NamePickers populating the same field, there appears to be no way to tell it to append the return values instead of overwriting them. Instead I am populating a set of five Hidden Input fields. 
 
It is also required that I display column 1 in the NamePicker pop-up and return column 1 to one field and column 2 to another. What can I add to the NamePicker code to do this? 
 
Do I have to do a @DbLookup against the first column value in a computed field and then add those results to another field that does the same thing  on a different list? If so, how and where can I trigger the @DbLookup?
 
 
 
Nov 17, 2011, 9:35 AM
261 Posts
Re: ExtLib NamePicker: How can I return a different column from the one shown?
Roy,
 
The <xe:simpleValuePicker> element has a labelSeparator attribute. It that be used to indicate what character is used in the list of possible options to separate a label from values.
 
Simple example:
 
<xe:djextListTextBox id="djSelect" displayLabel="true" value="#{sessionScope.mySelectedValue}"></xe:djextListTextBox>

 <xe:valuePicker id="valuePicker3" for="djSelect" dialogTitle="Selecteer a value" pickerText="Select">
        <xe:this.dataProvider>
            <xe:simpleValuePicker labelSeparator="|">
                <xe:this.valueList><![CDATA[#{javascript:[
    "Option 1|o1",
    "Option 2|o2"
]
}]]></xe:this.valueList>
            </xe:simpleValuePicker>
        </xe:this.dataProvider>

</xe:valuePicker>
 
Mark
Nov 17, 2011, 3:29 PM
6 Posts
Re: ExtLib NamePicker: How can I return a different column from the one shown?
Thank you for the reply Marc, but it doesn't actually answer the question. I said I am using the NamePicker, not the ValuePicker. I am retrieving the names from a view in another database that contains over 1000 entries.  The dominoViewNamePicker does not have the same options as the ValuePicker so I cannot do what you suggested
Nov 18, 2011, 10:00 AM
261 Posts
Re: ExtLib NamePicker: How can I return a different column from the one shown?
Ok. I'll have another try....
 
On closing the NamePicker dialog, the (client and serverside) onChange event of the (hidden) input it is linked to is called. Perhaps you could write a function in that event to lookup the value from column2 you are looking for. It might look like this:
 
<xp:inputHidden id="inputText1">
        <xp:eventHandler event="onchange" submit="true" refreshMode="complete">
            <xp:this.action><![CDATA[#{javascript:print("onchange");

//get the value the user selected in the namepicker
var selectedValue = this.getParent().getValue()

//get the view name used in the namepicker
var dataProvider = getComponent("namePicker1").getDataProvider();
var vw = dataProvider.getViewName();

//name of the column to use to retrieve an alias for the selected name
var aliasColumn = "id";

//lookup the alias
var alias = @DbLookup(@DbName(), vw, selectedValue, aliasColumn);

//set the alias in field inputText2
getComponent("inputText2").setValue(alias);

}]]></xp:this.action>


        </xp:eventHandler>
    </xp:inputHidden>
 
Hope this helps.
 
Mark

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal